package com.rybbaby.tss.front.tssMemberTurnHistoryRecord.dao.imp;

import com.rybbaby.tss.core.web.dao.imp.GenericDao;
import com.rybbaby.tss.front.tssMemberTurnHistoryRecord.dao.ITssMemberTurnHistoryRecordDao;
import com.rybbaby.tss.front.tssMemberTurnHistoryRecord.entity.TssMemberTurnHistoryRecord;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @description 会员课时包数据库操作实现
 * 
 * @author 雷春琼
 * 
 * @createDate 2017-08-10 上午12:04:35
 */
@Repository
public class TssMemberTurnHistoryRecordDaoImp extends GenericDao<TssMemberTurnHistoryRecord> implements ITssMemberTurnHistoryRecordDao {


    @Override
    public List<Map<String, Object>> getDetailListByMemberId(String memberId, Integer type) {
        String sql="SELECT\n" +
                "\tth.handleMatter,\n" +
                "\tth.HandleContent,\n" +
                "\tth.createTime,\n" +
                "\te.userName\n" +
                "FROM\n" +
                "\ttss_member_turn_history_record th\n" +
                "LEFT JOIN tss_student ts ON ts.id = th.memberId\n" +
                "LEFT JOIN tss_member_package mp ON mp.memberId = ts.id\n" +
                "LEFT JOIN sys_admin_user e ON e.id = th.adminUserId\n" +
                "WHERE\n" +
                "\tth.memberId = ?\n" +
                "AND mp.type =?";
        return this.findForJdbc(sql,new Object[]{memberId,type});
    }
}
